// SFEditor 核心样式类
.sf-editor {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #EAECEE;

    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }

    // svg canvas 绘制元件核心区
    &-box {
        width: 100%;
        height: 100%;
        position: absolute;
        left: 0;
        top: 0;

        // 用于绘制 graph
        &-graphs {
            position: relative;
            width: 100%;
            height: 100%;
            overflow: hidden;

            // 其他元件样式
            &-main {
                position: absolute;
                left: 0;
                top: 0;

                // graph 元件
                &-item {
                    cursor: move;
                    position: relative;

                    .user {
                        width: 100px;
                        overflow: hidden;
                        position: absolute;
                        left: 110%;
                        top: -10px;
                        border: solid red 1px;
                    }
                }

                // 链接锚点
                &-links,
                &-formats {
                    position: absolute;
                    top: 0;
                    left: 0;
                    width: 100%;
                    height: 100%;
                    pointer-events: none;
                }

                &:hover &-links {
                    display: block;
                }

                &-links {
                    z-index: 2;
                    display: none;

                    div {
                        pointer-events: all;
                        cursor: crosshair;
                        border: solid transparent 1px;

                        &:hover {
                            background-color: rgb(6, 123, 239) !important;
                        }
                    }
                }

                // 形变锚点
                &-formats {
                    z-index: 1;
                    display: none;

                    div {
                        pointer-events: all;
                        cursor: crosshair;
                        border: solid transparent 1px;
                    }

                    // 旋转锚点
                    .rotate {
                        position: absolute;
                        right: -10px;
                        top: -10px;
                        height: 16px;
                        width: 16px;
                        background: url('') 100% 100% no-repeat;
                        cursor: url('') 16 16, grabbing;
                    }
                }

                // 可编辑 div
                &-contenteditable {
                    position: absolute;
                    left: 0;
                    top: 0;
                    width: 100%;
                    height: 100%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    text-align: center;

                    div {
                        width: calc(100% - 20px);

                        b {
                            color: var(--mainColor);
                        }

                        // 这个是选中的
                        span {
                            color: #fff;
                            background-color: var(--mainColor);
                        }

                        &:focus-visible {
                            outline: none;
                        }
                    }
                }
            }

            // 线条样式
            &-line {
                z-index: -1;
                pointer-events: none;
                position: absolute;
                width: 0;
                height: 0;
                left: 0;
                top: 0;
                // background-color: rgba(255, 0, 0, 0.1);
            }

            // 处理选中样式
            .selected {
                .sf-editor-box-graphs-main-links {
                    display: none;
                }

                .sf-editor-box-graphs-main-formats {
                    display: block;
                }

            }
        }

        // canvas => 用于绘制 网格、小圆点、水印部分
        &-canvas {
            background-color: #fff;
            position: absolute;
            left: 0;
            top: 0;
            z-index: -99;
        }

        // 右键菜单
        &-contextmenu {
            z-index: 999;
            width: 220px;
            position: absolute;
            left: 0;
            top: 0;
            background-color: #fff;
            box-shadow: 0 4px 10px 0 rgba(0, 0, 0, .1);

            // 右键菜单 控制svg模式 元件不显示
            .editor {
                .graph-item {
                    display: none !important;
                }
            }

            &-main {
                padding: 5px;

                // 分割线
                &-line {
                    border-bottom: 1px solid #e9edf2;
                    margin: 2px;
                }

                // 子元素
                &-item {
                    height: 32px;
                    line-height: 32px;
                    border-radius: 5px;
                    padding: 5px;
                    display: flex;
                    align-items: center;
                    justify-content: space-between;

                    span:nth-child(2) {
                        color: #a6b9cd;
                        font-size: 12px;
                    }

                    &:hover {
                        background-color: #f3f5f9;
                        cursor: pointer;
                    }
                }
            }
        }

        // 框选模态框
        &-selectmask {
            display: none;
            overflow: hidden;
            position: absolute;
            left: 0;
            top: 0;
            background-color: rgb(79, 130, 232);
            width: 0;
            height: 0;
            opacity: 0.3;
            z-index: 999;
            pointer-events: none
        }



    }

    // 元件库
    &-catalog {
        user-select: none;
        border-right: solid #ccc 1px;
        background-color: #fff;
        width: 220px;
        height: 100%;
        position: absolute;
        left: 0;
        top: 0;

        // 分割线
        .line {
            border-top: solid #ccc 1px;
            margin: 10px 0;
        }

        // title 前面的三角形
        .icon {
            width: 0;
            height: 0;
            position: absolute;
            left: 5px;
            border-top: 4px solid #212930;
            border-left: 4px solid transparent;
            border-right: 4px solid transparent;
        }

        // 关闭状态下，进行旋转角度即可
        .icon.close {
            transform: rotate(-90deg)
        }

        &-title {
            user-select: none;
            cursor: pointer;
            display: flex;
            align-items: center;
            position: relative;
            font-size: 14px;
            font-weight: 700;
            color: #212930;
            white-space: nowrap;
            text-overflow: ellipsis;
            overflow: hidden;
            margin: 0;
            padding: 4px 0 4px 20px;
        }


        &-item {
            padding: 5px 10px;
            display: none;
            flex-wrap: wrap;

            img {
                width: 100%;
                height: 120px;
            }

            .upload {
                border: 1px dashed #dcdfe6;
                border-radius: 6px;
                cursor: pointer;
                position: relative;
                overflow: hidden;
                height: 100px;
                width: 100px;
                display: flex;
                align-items: center;
                justify-content: center;

                i {
                    font-size: 28px;
                    color: #8c939d;
                    text-align: center;
                }
            }


            .graph {
                cursor: move;
                height: 40px;
                width: 40px;
                margin: 8px 0 0 8px;
                display: flex;
                align-items: center;
                justify-content: center;

                .logo {
                    color: #3080E9;
                }

                i {
                    font-size: 28px;
                }

                div {
                    width: 80%;
                    height: 80%;
                    border: solid 1px;

                }
            }


        }

        .more {
            width: 70%;
            position: absolute;
            bottom: 10px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            margin: auto;
            border-radius: 4px;
            overflow: hidden;
            padding: 2px 4px;
            color: #fff;
            background-color: #3080E9;
            border: 1px solid #3080E9
        }
    }

    // 顶部操作区
    &-operation {
        user-select: none;
        background-color: #fff;
        height: 60px;
        width: 100%;
        display: flex;
        flex-direction: column;
        z-index: 99;
        position: absolute;
        top: 0;
        left: 0;

        i {
            position: relative;
        }

        .line {
            border-right: solid #ccc 1px;
            margin: 0 5px;
            height: 80%;
            width: 1px;
        }

        &>div {
            flex: 1;
            display: flex;
            align-items: center;
        }

        &-top {
            display: flex;
            justify-content: space-between;
            align-items: center;

            &>div {
                height: 100%;
                display: flex;
                align-items: center;

            }



            .left {
                svg {
                    height: 30px;
                    width: 30px;
                    cursor: pointer;
                }

                span {
                    position: relative;
                    margin: 0 5px;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    height: 70%;
                    padding: 0 6px;
                    font-size: 13px;
                    border-radius: 4px;
                    cursor: pointer;

                    &:hover {
                        background-color: #dfe2e5;
                    }

                    .sf-left-box {
                        display: none;
                        position: absolute;
                        width: 220px;
                        padding: 0 4px;
                        z-index: 99;
                        border-radius: 4px;
                        left: 0px;
                        top: 25px;
                        background-color: #fff;
                        border: solid #ccc 1px;
                        box-shadow: 0 4px 10px 0 rgba(0, 0, 0, .1);

                        .line {
                            width: 100%;
                            height: 1px;
                            border-bottom: solid #ccc 1px;
                            margin: 5px 0;
                        }

                        &-item {
                            height: 32px;
                            cursor: pointer;
                            margin: 4px 0;
                            border-radius: 4px;
                            display: flex;
                            align-items: center;
                            justify-content: space-between;

                            span {
                                &:hover {
                                    background-color: #F3F5F9;
                                }

                                &:nth-child(2) {
                                    color: #a6b9cd;
                                    font-size: 12px;
                                }
                            }

                            // 主题部分样式
                            &-color {
                                display: block;
                                width: 14px;
                                height: 14px;
                                margin: 0;
                                padding: 0;
                                margin-right: 6px;
                                background-color: #ccc;
                            }

                            // 牡丹粉
                            .mdf {
                                background-color: #eea2a4;
                            }

                            // 石竹红
                            .szh {
                                background-color: #ee4863;
                            }

                            // 芝兰紫
                            .mdl {
                                background-color: #12aa9c;
                            }

                            // 尼罗蓝
                            .nll {
                                background-color: #2474b5;
                            }

                            // 晨曦红
                            .jgz {
                                background-color: #813c85;
                            }

                            i {
                                margin-right: 5px;
                            }

                            .shortcut {
                                color: #a6b9cd;
                                font-size: 12px;
                            }

                            &:hover {
                                background-color: #F3F5F9;
                            }
                        }
                    }
                }
            }

            .right {
                padding-right: 10px;

                div {
                    margin: 0 10px;
                }

                img {
                    height: 28px;
                    width: 28px;
                    cursor: pointer;
                    border-radius: 50%;
                }

                i {
                    cursor: pointer;
                    margin: 0 10px;
                }

                &-shear {
                    height: 90%;
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    border-radius: 4px;
                    color: #fff;
                    background-color: #3080E9;
                    border: 1px solid #3080E9;
                    font-size: 13px;
                    border-radius: 4px;
                    padding: 0 12px;
                    min-width: 42px;
                    cursor: pointer;
                }

                // 导出
                .sf-download {
                    position: relative;

                    .sf-left-box {
                        display: none;
                        position: absolute;
                        width: 120px;
                        padding: 0 4px;
                        z-index: 99;
                        border-radius: 4px;
                        left: -15px;
                        top: 25px;
                        background-color: #fff;
                        border: solid #ccc 1px;
                        box-shadow: 0 4px 10px 0 rgba(0, 0, 0, .1);

                        &-item {
                            position: relative;
                            width: 100%;
                            height: 32px;
                            cursor: pointer;
                            margin: 4px 0;
                            padding: 0 15px;
                            border-radius: 4px;
                            display: flex;
                            align-items: center;
                            justify-content: space-between;
                            font-size: 14px;

                            &:hover {
                                background-color: #F3F5F9;
                            }
                        }

                        span:nth-child(2) {
                            color: #FFF685;
                            font-size: 12px;
                        }
                    }
                }
            }

        }

        &-bottom {
            border-bottom: solid #ccc 1px;
            position: relative;

            img {
                position: absolute;
                right: 10px;
                height: 20px;
                cursor: pointer;
            }

            i {
                border-radius: 4px;
                padding: 4px;
                margin: 0 4px;
                cursor: pointer;
                color: #212930;

                &:hover {
                    background-color: #DFE2E5;
                }
            }
        }

    }

    // 底部功能区
    &-footer {
        user-select: none;
        z-index: 99;
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
        border-top: solid #ccc 1px;
        background-color: #fff;
        height: 24px;
        display: flex;
        align-items: center;
        justify-content: space-between;

        i {
            cursor: pointer;
        }

        .line {
            border-right: solid #ccc 1px;
            height: 80%;
            width: 1px;
        }

        &>div {
            display: flex;
            align-items: center;
            height: 100%;

            * {
                margin: 0 5px;
            }
        }

        &-left {
            display: flex;

            span {
                background: rgba(0, 0, 0, .1);
                padding: 0 10px;
                border-radius: 4px;
                display: block;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
                user-select: none;
            }
        }

        &-right {
            .pageScale {
                cursor: pointer;
                width: 45px;
                text-align: center;
            }
        }
    }

    // 蒙版
    &-mask {
        position: absolute;
        width: 100%;
        height: 100%;
        left: 0;
        top: 0;
        z-index: 98;
    }

    // 所有的弹窗信息位置展示
    &-dialog {
        position: absolute;
        z-index: 999;
        background-color: #fff;
        right: 0;
        top: 0;
        width: 260px;
        height: 100%;
        border: solid #ccc 1px;
        overflow: hidden;
        overflow-y: auto;
        padding: 20px;
        border-top-left-radius: 10px;
        border-bottom-left-radius: 10px;

        // 标题
        .title {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: space-between;
            color: #72767b;
            font-size: 18px;
            height: 50px;
            font-weight: 700;
            padding-bottom: 20px;

            span {
                padding-bottom: 5px;
                border-bottom: solid var(--mainColor) 2px;
            }

            i {
                cursor: pointer;
            }
        }

        // 内容区
        .main {
            height: calc(100% - 50px);
            overflow: hidden;
            overflow-y: auto;
        }
    }

    // 元件单击信息弹窗
    &-graphBox {
        &-item {
            margin-bottom: 20px;

            span {
                font-size: 12px;
                color: #1b1b1f;
                font-weight: 400;
            }

            div {
                display: flex;
                align-items: center;
                margin-top: 5px;

                span {
                    display: flex;
                    align-items: center;
                    justify-content: center;
                    position: relative;
                    margin-right: 5px;
                    width: 20px;
                    height: 20px;
                    border-radius: 4px;
                    cursor: pointer;
                    border: solid #ccc 1px;
                }

                .icon {
                    border: none;

                    &:hover {
                        border: solid #ccc 1px;

                    }
                }

                .transparent {
                    background: url('') 100% 100% no-repeat;
                    background-size: 20px 20px;
                }

                .line {
                    border-right: solid #ccc 1px;
                    width: 1px;
                    height: 20px;
                    cursor: default;
                    margin: 0 5px;
                }


                // 圆角
                .borderRadius::after {
                    content: "";
                    position: absolute;
                    top: 40%;
                    width: 80%;
                    height: 80%;
                    left: -20%;
                    border: solid 2px;
                }

                .borderRadius {
                    overflow: hidden;

                    &-one::after {
                        border-top-right-radius: 1px;
                    }

                    &-two::after {
                        border-top-right-radius: 5px;
                    }

                    &-three::after {
                        border-top-right-radius: 9px;
                    }
                }

                input {
                    width: 20px;
                    height: 20px;
                }
            }
        }

        // 画布设置相关样式
        .background {
            div {
                flex-direction: column;

                span {
                    margin: 5px 0;
                    padding: 12px 20px;
                    width: 100%;
                    display: flex;
                    justify-content: flex-start;
                }


                input {
                    width: 45%;
                }
            }

            .custom {
                flex-direction: row;
            }

        }

        #watertext {
            width: 100%;
            outline: none;
        }
    }

    // 修改滚动条的样式
    &-overflow {
        position: relative;
        overflow: hidden;
        overflow-y: auto;

        /* 设置滚动条的宽度 */
        &::-webkit-scrollbar {
            width: 4px;
            /* 水平滚动条的高度 */
            height: 4px;
            /* 垂直滚动条的宽度 */
        }

        /* 设置滚动条滑块的样式 */
        &::-webkit-scrollbar-thumb {
            background-color: darkgrey;
            border-radius: 4px;
        }

        /* 设置滚动条轨道的样式 */
        &::-webkit-scrollbar-track {
            background: lightgrey;
            /* 轨道颜色 */
            display: none;
        }
    }

    // 协同用户光标
    &-network {
        box-shadow: 0 4px 10px 0 rgba(255, 0, 0, 0.4);
        position: relative;
    }

    // 搜索替换框
    &-search {
        box-shadow: 0 4px 10px 0 rgba(0, 0, 0, 0.2);
        position: absolute;
        background-color: #fff;
        border-radius: 4px;
        right: 10px;
        top: 30px;
        z-index: 999;
        padding: 10px;
        min-width: 200px;
        min-height: 30px;

        &-top {
            margin-bottom: 5px;
            display: flex;
            align-items: center;

            div {
                width: 160px;
                height: 25px;
                border-radius: 4px;
                border-top-right-radius: 0;
                border-bottom-right-radius: 0;
                padding: 4px;
                display: flex;
                align-items: center;
                justify-content: space-between;
                border: solid light-dark(rgb(118, 118, 118), rgb(133, 133, 133)) 1px;
            }

            input {
                border: none;
                max-width: 100px;

                &:focus-visible {
                    outline: none;
                }
            }

            .icon-xiangzuo,
            .icon-xiangyou {
                display: flex;
                align-items: center;
                justify-content: center;
                height: 25px;
                border: solid light-dark(rgb(118, 118, 118), rgb(133, 133, 133)) 1px;
                border-left: none;
            }

            .icon-xiangyou {
                border-top-right-radius: 4px;
                border-bottom-right-radius: 4px;
            }

            .icon-xgb {
                margin-left: 5px;
            }

            i {
                cursor: pointer;
            }

            span {
                user-select: none;
                font-size: 12px;
                color: #3d4757;
            }
        }

        &-bottom {
            input {
                height: 25px;
                padding: 4px;
                width: 160px;
                border: solid light-dark(rgb(118, 118, 118), rgb(133, 133, 133)) 1px;
                border-radius: 4px;

                &:focus-visible {
                    outline: none;
                }
            }

            i {
                cursor: pointer;
            }
        }
    }

    // 加载
    &-loading {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.05);
        z-index: 999;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: wait;

        svg {
            width: 50px;
            height: 50px;
            animation: loading 1s linear forwards infinite;
        }
    }

    // 表格
    &-table {
        border: #ebeef5 1px solid !important;

        &-title {
            height: 30px;
            width: 100%;
        }

        &-content {
            height: calc(100% - 30px);
            width: 100%;
        }

        table {
            width: 100%;
            border-collapse: collapse;
            user-select: none;

            thead {
                tr {
                    background-color: #fff !important;
                }
            }

            tr {
                display: flex;
                min-height: 30px;

                td,
                th {

                    flex: 1;
                    border: #ebeef5 1px solid;
                    overflow: hidden;

                    div {
                        overflow: hidden;
                        text-overflow: ellipsis;
                        white-space: normal;
                        overflow-wrap: break-word;
                        line-height: 30px;
                        text-align: center;
                        width: 100%;
                        height: 100%;
                        outline: none
                    }
                }
            }


        }

        // 斑马纹
        &--stripe {
            tr {
                &:nth-child(odd) {
                    background-color: #FAFAFA;
                }

                &:nth-child(even) {
                    background-color: #fff;
                }
            }
        }
    }
}

@keyframes loading {
    from {
        transform: rotate(-360deg);
    }
}